diff --git a/schoolaccess.php b/schoolaccess.php index 1e5b4c3..6eb6ddf 100644 --- a/schoolaccess.php +++ b/schoolaccess.php @@ -33,17 +33,17 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) { if($_POST['action']=="save") { - mysql_query("UPDATE schools SET - school='".mysql_escape_string(stripslashes($_POST['school']))."', - address='".mysql_escape_string(stripslashes($_POST['address']))."', - city='".mysql_escape_string(stripslashes($_POST['city']))."', - province_code='".mysql_escape_string(stripslashes($_POST['province_code']))."', - postalcode='".mysql_escape_string(stripslashes($_POST['postalcode']))."', - phone='".mysql_escape_string(stripslashes($_POST['phone']))."', - fax='".mysql_escape_string(stripslashes($_POST['fax']))."', - sciencehead='".mysql_escape_string(stripslashes($_POST['sciencehead']))."', - scienceheademail='".mysql_escape_string(stripslashes($_POST['scienceheademail']))."', - scienceheadphone='".mysql_escape_string(stripslashes($_POST['scienceheadphone']))."' + mysql_query("UPDATE schools SET + school='".mysql_escape_string(stripslashes($_POST['school']))."', + address='".mysql_escape_string(stripslashes($_POST['address']))."', + city='".mysql_escape_string(stripslashes($_POST['city']))."', + province_code='".mysql_escape_string(stripslashes($_POST['province_code']))."', + postalcode='".mysql_escape_string(stripslashes($_POST['postalcode']))."', + phone='".mysql_escape_string(stripslashes($_POST['phone']))."', + fax='".mysql_escape_string(stripslashes($_POST['fax']))."', + sciencehead='".mysql_escape_string(stripslashes($_POST['sciencehead']))."', + scienceheademail='".mysql_escape_string(stripslashes($_POST['scienceheademail']))."', + scienceheadphone='".mysql_escape_string(stripslashes($_POST['scienceheadphone']))."' WHERE id='$school->id'"); if(mysql_error()) @@ -60,10 +60,10 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) /* if($_POST['action']=="numbers") { - mysql_query("UPDATE schools SET - junior='".$_POST['junior']."', - intermediate='".$_POST['intermediate']."', - senior='".$_POST['senior']."' + mysql_query("UPDATE schools SET + junior='".$_POST['junior']."', + intermediate='".$_POST['intermediate']."', + senior='".$_POST['senior']."' WHERE id='$school->id'"); echo mysql_error(); @@ -77,38 +77,40 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) if($_POST['action']=="feedback") { $body=""; - $body.=$_SERVER['REMOTE_ADDR']." (".$_SERVER['REMOTE_HOST'].")\n"; $body.=date("r")."\n"; + $body.=$_SERVER['REMOTE_ADDR']." (".$_SERVER['REMOTE_HOST'].")\n"; $body.="School ID: $school->id\n"; $body.="School Name: $school->school\n"; - $body.="Feedback:\n".$_POST['feedbacktext']."\n"; - echo "mailing ".$config['fairmanageremail']; - mail($config['fairmanageremail'],"School Feedback",$body,"From: webpage@".$_SERVER['SERVER_NAME']); - echo happy(i18n("Thanks for your feedback!")); - + if($school->sciencehead) $body.="Science Teacher: $school->sciencehead\n"; + if($school->scienceheadphone) $body.="Science Teacher Phone: $school->scienceheadphone\n"; + if($school->scienceheademail) $body.="Science Teacher Email: $school->scienceheademail\n"; + $body.="\nFeedback:\n".stripslashes($_POST['feedbacktext'])."\n"; + $returnEmailAddress = $school->scienceheademail; + mail($config['fairmanageremail'],"School Feedback",$body,"From: ". $returnEmailAddress."\nReply-To: ".$returnEmailAddress."\nReturn-Path: ".$returnEmailAddress); + echo happy(i18n("Your feedback has been sent")); } echo "

$school->school

"; - echo "

School Information

"; - echo "Please make sure your school contact information is correct, make any necessary changes:"; + echo "

".i18n("School Information")."

"; + echo i18n("Please make sure your school contact information is correct, make any necessary changes:"); echo "
"; echo ""; echo ""; - echo ""; + echo ""; // echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo "\n"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo "
School Nameschool\" type=text name=school size=40>
".i18n("School Name")."school\" type=text name=school size=40>
Registration Passwordregistration_password\" type=text name=\"registration_password\" size=\"20\">
Addressaddress\" type=text name=address size=40>
Citycity\" type=text name=city size=30>
".i18n("Address")."address\" type=text name=address size=40>
".i18n("City")."city\" type=text name=city size=30>
".i18n("Province").""; emit_province_selector("province_code",$school->province_code); echo "
Postalcodepostalcode\" type=text name=postalcode size=10>
Phone Numberphone\" type=text name=phone size=30>
Fax Numberfax\" type=text name=fax size=30>
Science Teachersciencehead\" type=text name=sciencehead size=40>
Science Teacher Emailscienceheademail\" type=text name=scienceheademail size=40>
Science Teacher Phone
(If different than above)
scienceheadphone\" type=text name=scienceheadphone size=30>
".i18n("Postal Code")."postalcode\" type=text name=postalcode size=10>
".i18n("Phone Number")."phone\" type=text name=phone size=30>
".i18n("Fax Number")."fax\" type=text name=fax size=30>
".i18n("Science Teacher")."sciencehead\" type=text name=sciencehead size=40>
".i18n("Science Teacher Email")."scienceheademail\" type=text name=scienceheademail size=40>
".i18n("Science Teacher Phone")."
(".i18n("If different than above").")
scienceheadphone\" type=text name=scienceheadphone size=30>
"; - echo ""; + echo ""; echo "
"; echo "
"; @@ -125,7 +127,7 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) } else if($config['participant_registration_type']=="invite" || $config['participant_registration_type']=="openorinvite" ) { - + echo "

".i18n("Participant Registration Invitations")."

"; if($config['participant_registration_type']=="invite") echo i18n("In order for your school's students to register for the fair, you must first invite them via email. Use the 'Participant Registration Invitations' link below to invite your students to the fair"); @@ -137,78 +139,25 @@ if($_SESSION['schoolid'] && $_SESSION['schoolaccesscode']) echo "
"; } - /* - //the participation section needs to be updated to handle the age categories as specified - //in the categories table and the numbers from configuration, for now, lets just not do it. - //this code is copied from the ORSF schoolaccess page, thats why its here, but just commented out. - - echo "

Participation Information

"; - echo "Please select the number of projects you anticipate on sending to the fair in each of the age categories"; - echo "
"; - echo ""; - echo ""; - - - echo ""; - - - echo ""; - - - echo ""; - - - echo "
Junior (Grades 7-8)"; - echo ""; - echo "
Intermediate (Grades 9-10)"; - echo ""; - echo "
Senior (Grades 11-12)"; - echo ""; - echo "
"; - - echo ""; - echo "
Please note, these numbers are only an estimate to help us plan the fair. Choosing small numbers here in no way limits your actual participation.
\n"; - echo "
"; - - */ echo "
"; - echo "

School Feedback / Questions

"; + echo "

".i18n("School Feedback / Questions")."

"; + echo i18n("We are always welcome to any feedback (both positive and constructive crisicism!), or any questions you may have. Please use the following form to communicate with the science fair committee!"); + if($school->scienceheademail) { echo "
"; echo ""; - echo "We are always welcome to any feedback (both positive and constructive crisicism!), or any questions you may have. Please use the following box to communicate with us!"; echo "

"; echo ""; echo "
"; - - - + } + else + echo error(i18n("Feedback is disabled until a science teacher email address is entered above")); } - else - { - echo "Invalid School ID or Access Code (2)"; + else { + echo error(i18n("Invalid School ID or Access Code")); } } -else -{ +else { if($errormsg) echo "$errormsg"; if($happymsg) echo happy($happymsg); @@ -234,9 +183,15 @@ else