forked from science-ation/science-ation
ba793ac8e0
Fix tableeditor css to only modify anything in the tableeditor/tableview classes Fix saving language for volunteers Fix error message for saving phone numbers on organization and personal Fix schoolfeedback and schoolinfo pages Update school select tab, better html and school options list Fix css for tertiary menu to show difference between selected and non-selected
69 lines
3.2 KiB
PHP
69 lines
3.2 KiB
PHP
<?php
|
|
require_once('common.inc.php');
|
|
require_once('user.inc.php');
|
|
|
|
user_auth_required("teacher");
|
|
$schoolid=user_field_required("schools_id","user_edit.php?tab=school");
|
|
|
|
send_header("School Details");
|
|
|
|
if($_POST['action']=="save") {
|
|
// load the school info so we know which one we're saving
|
|
$q=mysql_query("SELECT * FROM schools WHERE id='$schoolid'");
|
|
$school=mysql_fetch_object($q);
|
|
|
|
mysql_query("UPDATE schools SET
|
|
school='".mysql_real_escape_string($_POST['school'])."',
|
|
address='".mysql_real_escape_string($_POST['address'])."',
|
|
city='".mysql_real_escape_string($_POST['city'])."',
|
|
province_code='".mysql_real_escape_string($_POST['province_code'])."',
|
|
postalcode='".mysql_real_escape_string($_POST['postalcode'])."',
|
|
phone='".mysql_real_escape_string($_POST['phone'])."',
|
|
fax='".mysql_real_escape_string($_POST['fax'])."'
|
|
WHERE id='$school->id'");
|
|
|
|
echo mysql_error();
|
|
if(mysql_error())
|
|
echo error(i18n("An Error occured trying to save the school information"));
|
|
else
|
|
echo happy(i18n("School information successfully updated"));
|
|
|
|
}
|
|
// load the school info
|
|
$q=mysql_query("SELECT * FROM schools WHERE id='$schoolid'");
|
|
$school=mysql_fetch_object($q);
|
|
|
|
draw_page();
|
|
send_footer();
|
|
|
|
function draw_page(){
|
|
global $config, $school, $sh_email, $sh_email, $sh;
|
|
|
|
echo i18n("Please make sure your school contact information is correct, make any necessary changes:");
|
|
echo "<form method=\"post\" action=\"schoolinfo.php\">";
|
|
echo "<input type=\"hidden\" name=\"action\" value=\"save\">";
|
|
echo "<table border=0 cellspacing=0 cellpadding=3>";
|
|
echo "<tr><td>".i18n("School Name")."</td><td><input value=\"$school->school\" type=\"text\" name=\"school\" size=\"40\"></td></tr>";
|
|
// echo "<tr><td>Registration Password</td><td><input value=\"$school->registration_password\" type=text name=\"registration_password\" size=\"20\"></td></tr>";
|
|
echo "<tr><td>".i18n("Address")."</td><td><input value=\"$school->address\" type=text name=address size=40></td></tr>";
|
|
echo "<tr><td>".i18n("City")."</td><td><input value=\"$school->city\" type=text name=city size=30></td></tr>";
|
|
echo "<tr><td>".i18n($config['provincestate'])."</td><td>";
|
|
emit_province_selector("province_code",$school->province_code);
|
|
echo "</td></tr>\n";
|
|
echo "<tr><td>".i18n($config['postalzip'])."</td><td><input value=\"$school->postalcode\" type=text name=postalcode size=10></td></tr>";
|
|
echo "<tr><td>".i18n("Phone Number")."</td><td><input value=\"$school->phone\" type=text name=phone size=30></td></tr>";
|
|
echo "<tr><td>".i18n("Fax Number")."</td><td><input value=\"$school->fax\" type=text name=fax size=30></td></tr>";
|
|
|
|
/*
|
|
echo "<tr><td>".i18n("Science Teacher")."</td><td><input value=\"{$sh['name']}\" type=text name=sciencehead size=40></td></tr>";
|
|
echo "<tr><td>".i18n("Science Teacher Email")."</td><td><input value=\"$sh_email\" type=text name=scienceheademail size=40></td></tr>";
|
|
echo "<tr><td>".i18n("Science Teacher Phone")."<br><font size=1>(".i18n("If different than above").")</font></td><td><input value=\"{$sh['phonework']}\" type=text name=scienceheadphone size=30></td></tr>";
|
|
*/
|
|
echo "</table>";
|
|
echo "<input type=submit value=\"".i18n("Save Changes")."\">";
|
|
echo "</form>";
|
|
echo "<br>";
|
|
}
|
|
|
|
?>
|