\n";
echo " ".theme_icon("edit_profile")." ".i18n("Edit My Profile")." | ";
echo " ".theme_icon("change_password")." ".i18n("Change My Password")." | ";
@@ -55,9 +58,11 @@
//this is temporary just so i can put it somewhere to be clicked on to demo tomorrow
//it wont be here for good :)
- echo "
";
- echo "
";
- echo " SFIAB/SOIAB Super Config
";
+ if(committee_auth_has_access('super')) {
+ echo "
";
+ echo "
";
+ echo " Science In A Box Super Configuration
";
+ }
send_footer();
diff --git a/common.inc.php b/common.inc.php
index 242c584..9d710ef 100644
--- a/common.inc.php
+++ b/common.inc.php
@@ -37,6 +37,8 @@ define('REQUIREDFIELD','*');
//figure out the directory to prepend to directoroy names, depending on if we are in a subdirectory or not
if(substr(getcwd(),-6)=="/admin")
$prependdir="../";
+else if(substr(getcwd(),-6)=="/super")
+ $prependdir="../";
else if(substr(getcwd(),-7)=="/config")
$prependdir="../";
else if(substr(getcwd(),-3)=="/db")
@@ -229,25 +231,19 @@ if(stristr($_SERVER['HTTP_USER_AGENT'],"MSIE"))
else
$config['icon_extension']="png";
-
-
//now get the languages, and make sure we have at least one active language
$q=mysql_query("SELECT * FROM languages WHERE active='Y' ORDER BY langname");
-if(mysql_num_rows($q)==0)
-{
+if(mysql_num_rows($q)==0) {
echo "No active languages defined, defaulting to English";
$config['languages']['en']="English";
}
-else
-{
- while($r=mysql_fetch_object($q))
- {
+else {
+ while($r=mysql_fetch_object($q)) {
$config['languages'][$r->lang]=$r->langname;
}
}
//now if no language has been set yet, lets set it to the default language
-if(!$_SESSION['lang'])
-{
+if(!$_SESSION['lang']) {
//first try the default language, if that doesnt work, use "en"
if($config['default_language'])
$_SESSION['lang']=$config['default_language'];
@@ -255,21 +251,43 @@ if(!$_SESSION['lang'])
$_SESSION['lang']="en";
}
+if(isset($_GET['switchconference'])) {
+ //make sure its good
+ $cid=intval($_GET['switchconference']);
+// echo "cid=$cid";
+ if($cid==0) {
+ //default for old science fair system
+ $_SESSION['conferenceid']=0;
+ }
+ else {
+ $q=mysql_query("SELECT * FROM conferences WHERE id='$cid' AND status='running'");
+ if($r=mysql_fetch_object($q)) {
+ $_SESSION['conferenceid']=$cid;
+ }
+ }
+}
+
+if($_SESSION['conferenceid']) {
+ $q=mysql_query("SELECT * FROM conferences WHERE id='".$_SESSION['conferenceid']."'");
+ $conference=mysql_fetch_assoc($q);
+}
+else {
+ $conference['id']=0;
+ $conference['name']=$config['fairname'];
+ $conference['type']="sciencefair";
+}
+
//only allow debug to get set if we're using a development version (odd numbered ending)
if(substr($config['version'], -1) % 2 != 0)
if($_GET['debug']) $_SESSION['debug']=$_GET['debug'];
//if the user has switched languages, go ahead and switch the session variable
-if($_GET['switchlanguage'])
-{
+if($_GET['switchlanguage']) {
//first, make sure its a valid language:
- if($config['languages'][$_GET['switchlanguage']])
- {
+ if($config['languages'][$_GET['switchlanguage']]) {
$_SESSION['lang']=$_GET['switchlanguage'];
-
}
- else
- {
+ else {
//invalid language, dont do anything
}
}
@@ -434,7 +452,13 @@ if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config")
if(file_exists($prependdir."data/logo-100.gif"))
echo "";
-echo "".i18n($config['fairname'])."
";
+if(!$_SESSION['conferenceid']) {
+ echo "".i18n($config['fairname'])."
";
+} else {
+ global $conference;
+ echo "".i18n($conference['name'])."
";
+
+}
echo "";
if(isset($_SESSION['users_type'])) {
$types = array('volunteer' => 'Volunteer', 'judge' => 'Judge',
@@ -486,6 +510,34 @@ echo "
";
?>
+
+ $q=mysql_query("SELECT * FROM conferences WHERE status='running'");
+ if(mysql_num_rows($q)) {
+ echo "
";
+ if($_SESSION['conferenceid']==0)
+ $cl="class=\"selected\"";
+ else
+ $cl="";
+
+ echo "- ".i18n("Science Fair")."
\n";
+ while($r=mysql_fetch_object($q)) {
+ if($_SESSION['conferenceid']==$r->id)
+ $cl="class=\"selected\"";
+ else
+ $cl="";
+ echo "- id\">$r->name
\n";
+ }
+ echo "
\n";
+ echo "
";
+ }
+ else {
+ $_SESSION['conferenceid']=0;
+ }
+ ?>
+
+
+
+
if(is_array($nav)) {
$navkeys=array_keys($nav);
diff --git a/config/index.php b/config/index.php
index 95fc9e5..8d4db65 100644
--- a/config/index.php
+++ b/config/index.php
@@ -26,32 +26,44 @@
require_once("../user.inc.php");
user_auth_required('committee', 'config');
- send_header("SFIAB Configuration",
+ send_header("Configuration",
array('Committee Main' => 'committee_main.php')
,"configuration"
);
+ if($conference['type']=='scienceolympics') {
+ echo "
\n";
+ }
+ else {
+ echo "
\n";
+ }
- echo "
\n";
echo "
";
echo "
";
echo " ";
diff --git a/db/db.code.version.txt b/db/db.code.version.txt
index b34c321..730a054 100644
--- a/db/db.code.version.txt
+++ b/db/db.code.version.txt
@@ -1 +1 @@
-171
+172
diff --git a/db/db.update.172.sql b/db/db.update.172.sql
new file mode 100644
index 0000000..1552e0b
--- /dev/null
+++ b/db/db.update.172.sql
@@ -0,0 +1,7 @@
+CREATE TABLE `conferences` (
+ `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+ `name` VARCHAR( 128 ) NOT NULL ,
+ `type` ENUM( 'sciencefair', 'scienceolympics' ) NOT NULL ,
+ `status` ENUM( 'pending', 'running', 'ended' ) NOT NULL
+) ENGINE = MYISAM ;
+ALTER TABLE `config` ADD `conferences_id` INT NULL DEFAULT NULL;
diff --git a/login.php b/login.php
index fd8ee43..1fc4891 100644
--- a/login.php
+++ b/login.php
@@ -22,33 +22,36 @@
?>
require_once("common.inc.php");
- send_header("Login/Register");
+ send_header(i18n("Login/Register for the %1",array($conference['name'])),true);
echo i18n("Please choose one of the following:");
echo "
\n";
echo "
\n";
- echo "".i18n("Participant")."
\n";
+ echo "".i18n("Student Participant")."
\n";
echo "\n";
- echo "".i18n("Judge")."
\n";
+ echo "".i18n("Teacher/School")."
\n";
echo "\n";
+ //we only have judges for science fairs
+ if($conference['type']=="sciencefair") {
+ echo "".i18n("Judge")."
\n";
+ echo "\n";
+ }
+
echo "".i18n("Sponsor")."
\n";
echo "\n";
- echo "".i18n("Teacher/School")."
\n";
- echo "\n";
-
if($config['volunteer_enable'] == 'yes') {
echo "".i18n("Volunteer")."
\n";
echo "";
diff --git a/super/conferences.php b/super/conferences.php
new file mode 100644
index 0000000..3802362
--- /dev/null
+++ b/super/conferences.php
@@ -0,0 +1,62 @@
+
+/*
+ This file is part of the 'Science Fair In A Box' project
+ SFIAB Website: http://www.sfiab.ca
+
+ Copyright (C) 2005-2006 Sci-Tech Ontario Inc
+ Copyright (C) 2005-2008 James Grant
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation, version 2.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+?>
+
+ require("../common.inc.php");
+ require_once("../user.inc.php");
+ user_auth_required('committee', 'super');
+
+ send_header("Conferences Setup",
+ array('Committee Main' => 'committee_main.php',
+ 'Science In A Box Super Configuration' => '/super/index.php')
+ ,"configuration"
+ );
+ ?>
+
+
+
+
+
+
+ require("../tableeditor.class.php");
+
+ $editor=new TableEditor("conferences",
+ array(
+ "name"=>"Conference Name",
+ "type"=>"Type",
+ )
+ );
+
+ $editor->setPrimaryKey("id");
+ $editor->setDefaultSortField("id");
+ $editor->setRecordType("Conference");
+ $editor->execute();
+?>
+
+
+
+ send_footer();
+?>
diff --git a/super/index.php b/super/index.php
new file mode 100644
index 0000000..1c7b79c
--- /dev/null
+++ b/super/index.php
@@ -0,0 +1,45 @@
+
+/*
+ This file is part of the 'Science Fair In A Box' project
+ SFIAB Website: http://www.sfiab.ca
+
+ Copyright (C) 2005-2006 Sci-Tech Ontario Inc
+ Copyright (C) 2005-2008 James Grant
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation, version 2.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+?>
+
+ require("../common.inc.php");
+ require_once("../user.inc.php");
+ user_auth_required('committee', 'super');
+
+ send_header("Science In A Box Super Configuration",
+ array('Committee Main' => 'committee_main.php')
+ ,"configuration"
+ );
+
+
+ echo "\n";
+
+ send_footer();
+?>
diff --git a/super/superconfig.php b/super/superconfig.php
new file mode 100644
index 0000000..58a59ad
--- /dev/null
+++ b/super/superconfig.php
@@ -0,0 +1,103 @@
+
+/*
+ This file is part of the 'Science Fair In A Box' project
+ SFIAB Website: http://www.sfiab.ca
+
+ Copyright (C) 2005-2006 Sci-Tech Ontario Inc
+ Copyright (C) 2005-2008 James Grant
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation, version 2.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+?>
+
+ require("../common.inc.php");
+ require_once("../user.inc.php");
+ user_auth_required('committee', 'config');
+
+ send_header("SFIAB/SOIAB Super Configuration",
+ array('Committee Main' => 'committee_main.php')
+ ,"configuration"
+ );
+
+?>
+
+
+
+
+
+Science Fair
+
+
+
+
+
+ |
+
+Science Olympics
+
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+ send_footer();
+?>
diff --git a/theme/classic/sfiab.css b/theme/classic/sfiab.css
index 1e1fa04..2d20a44 100644
--- a/theme/classic/sfiab.css
+++ b/theme/classic/sfiab.css
@@ -439,6 +439,59 @@ div.ui-tabs ul.ui-tabs-nav {
color: #c0c0c0;
}
+.judging_score {
+ text-align: right;
+}
+
+.switchon {
+ background-color: green;
+ color: white;
+}
+
+.switchoff {
+ background-color: red;
+ color: white;
+}
+
+ul.conferencenav {
+ list-style : none;
+ margin : 0;
+ padding : 0;
+ background-color : #d6d6d6;
+ width: 165px;
+}
+
+ul.conferencenav li {
+ display : block;
+ border-top : 1px solid #a5b5c6;
+}
+
+ul.conferencenav li a {
+ display : block;
+ margin : 0;
+ padding : 6px;
+ background-color : #5C6F90;
+ font : bold 0.9em/1.5em Arial, sans-serif;
+ color : #fff;
+ text-decoration : none;
+}
+
+ul.conferencenav li a.selected {
+ display : block;
+ margin : 0;
+ padding : 6px;
+ background-color : #1F6DFF;
+ font : bold 0.9em/1.5em Arial, sans-serif;
+ color : #fff;
+ text-decoration : none;
+}
+
+ul.conferencenav li a:hover {
+ background-color : #63616b;
+ color : #eee;
+ text-decoration: none;
+}
+
diff --git a/theme/default/sfiab.css b/theme/default/sfiab.css
index 576142b..e4dac2a 100644
--- a/theme/default/sfiab.css
+++ b/theme/default/sfiab.css
@@ -452,3 +452,44 @@ div.ui-tabs ul.ui-tabs-nav {
background-color: red;
color: white;
}
+
+ul.conferencenav {
+ list-style : none;
+ margin : 0;
+ padding : 0;
+ background-color : #d6d6d6;
+ width: 165px;
+}
+
+ul.conferencenav li {
+ display : block;
+ border-top : 1px solid #a5b5c6;
+}
+
+ul.conferencenav li a {
+ display : block;
+ margin : 0;
+ padding : 6px;
+ background-color : #5C6F90;
+ font : bold 0.9em/1.5em Arial, sans-serif;
+ color : #fff;
+ text-decoration : none;
+}
+
+ul.conferencenav li a.selected {
+ display : block;
+ margin : 0;
+ padding : 6px;
+ background-color : #1F6DFF;
+ font : bold 0.9em/1.5em Arial, sans-serif;
+ color : #fff;
+ text-decoration : none;
+}
+
+ul.conferencenav li a:hover {
+ background-color : #63616b;
+ color : #eee;
+ text-decoration: none;
+}
+
+