diff --git a/admin/exhibithall_sa.php b/admin/exhibithall_sa.php
index 48beb3d..7087511 100644
--- a/admin/exhibithall_sa.php
+++ b/admin/exhibithall_sa.php
@@ -215,7 +215,7 @@ TRACE("Grid size: {$grid_size}m\n");
$div = array();
TRACE("Loading Project Divisions...\n");
-$q=mysql_query("SELECT * FROM projectdivisions WHERE year='{$config['FAIRYEAR']}' ORDER BY id");
+$q=mysql_query("SELECT * FROM projectdivisions WHERE conferences_id='{$conference['id']}' ORDER BY id");
while($r=mysql_fetch_object($q))
{
$divshort[$r->id]=$r->division_shortform;
@@ -225,7 +225,7 @@ while($r=mysql_fetch_object($q))
TRACE("Loading Project Age Categories...\n");
$cat = array();
-$q=mysql_query("SELECT * FROM projectcategories WHERE year='{$config['FAIRYEAR']}' ORDER BY id");
+$q=mysql_query("SELECT * FROM projectcategories WHERE conferences_id='{$conference['id']}' ORDER BY id");
while($r=mysql_fetch_object($q)) {
$catshort[$r->id]=$r->category_shortform;
$cat[$r->id]=$r->category;
@@ -236,7 +236,7 @@ TRACE("Loading Projects...\n");
$projects = array();
$q = mysql_query("SELECT projects.* FROM projects, registrations
WHERE
- projects.year='{$config['FAIRYEAR']}'
+ projects.conferences_id='{$conference['id']}'
AND registrations.id = projects.registrations_id
".getJudgingEligibilityCode());
while($p = mysql_fetch_object($q)) {
@@ -597,7 +597,7 @@ for($x=0;$x<$a->num_buckets; $x++) {
print_r($projects);
/* Assign floor numbers */
-mysql_query("UPDATE projects SET floornumber=0 WHERE year='{$config['FAIRYEAR']}'");
+mysql_query("UPDATE projects SET floornumber=0 WHERE conferences_id='{$conference['id']}'");
foreach($projects as $pid=>$p) {
mysql_query("UPDATE projects SET floornumber='{$p['floornumber']}' WHERE id='$pid'");
diff --git a/admin/export_checkin.php b/admin/export_checkin.php
index d972f16..d3065fc 100644
--- a/admin/export_checkin.php
+++ b/admin/export_checkin.php
@@ -27,7 +27,7 @@
user_auth_required('admin');
require("../lpdf.php");
-$catq=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' AND id='".$_GET['cat']."'");
+$catq=mysql_query("SELECT * FROM projectcategories WHERE conferences_id='".$conference['id']."' AND id='".$_GET['cat']."'");
if($catr=mysql_fetch_object($catq))
{
@@ -48,7 +48,7 @@ if($catr=mysql_fetch_object($catq))
registrations
left outer join projects on projects.registrations_id=registrations.id
WHERE
- registrations.year='".$config['FAIRYEAR']."'
+ registrations.conferences_id='".$conference['id']."'
AND ( registrations.status='complete' OR registrations.status='paymentpending' )
AND projects.projectcategories_id='$catr->id'
ORDER BY
@@ -74,7 +74,7 @@ if($catr=mysql_fetch_object($catq))
}
while($r=mysql_fetch_object($q))
{
- $divq=mysql_query("SELECT division,division_shortform FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' AND id='".$r->projectdivisions_id."'");
+ $divq=mysql_query("SELECT division,division_shortform FROM projectdivisions WHERE conferences_id='".$conference['id']."' AND id='".$r->projectdivisions_id."'");
$divr=mysql_fetch_object($divq);
$sq=mysql_query("SELECT students.firstname,
diff --git a/admin/judges_jdiv.php b/admin/judges_jdiv.php
index 537e530..902f64f 100644
--- a/admin/judges_jdiv.php
+++ b/admin/judges_jdiv.php
@@ -56,14 +56,14 @@ function newbuttonclicked(jdivs)
$div = array();
$divshort = array();
- $q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
+ $q=mysql_query("SELECT * FROM projectdivisions WHERE conferences_id='".$conference['id']."' ORDER BY id");
while($r=mysql_fetch_object($q)) {
$divshort[$r->id]=$r->division_shortform;
$div[$r->id]=$r->division;
}
$cat = array();
- $q=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
+ $q=mysql_query("SELECT * FROM projectcategories WHERE conferences_id='".$conference['id']."' ORDER BY id");
while($r=mysql_fetch_object($q)) {
$cat[$r->id]=$r->category;
}
@@ -72,7 +72,7 @@ function newbuttonclicked(jdivs)
$ckeys = array_keys($cat);
if($config['filterdivisionbycategory']=="yes") {
- $q=mysql_query("SELECT * FROM projectcategoriesdivisions_link WHERE year='".$config['FAIRYEAR']."' ORDER BY projectdivisions_id,projectcategories_id");
+ $q=mysql_query("SELECT * FROM projectcategoriesdivisions_link WHERE conferences_id='".$conference['id']."' ORDER BY projectdivisions_id,projectcategories_id");
$divcat=array();
while($r=mysql_fetch_object($q)) {
$divcat[]=array("c"=>$r->projectcategories_id,"d"=>$r->projectdivisions_id);
@@ -97,7 +97,7 @@ function newbuttonclicked(jdivs)
function get_all_divs()
{
- global $config;
+ global $config, $conference;
global $divshort, $div,$cat, $langr;
global $divcat;
@@ -157,7 +157,7 @@ function get_all_divs()
" projectdivisions_id='{$cdl[$id]['div']}' ".
" AND projectcategories_id='{$cdl[$id]['cat']}' ".
" AND language='{$cdl[$id]['lang']}' ".
- " AND registrations.year='{$config['FAIRYEAR']}'".
+ " AND registrations.conferences_id='{$conference['id']}'".
" AND projects.registrations_id=registrations.id".
" AND (registrations.status='complete' OR registrations.status='paymentpending')");
diff --git a/admin/judges_teams_projects.php b/admin/judges_teams_projects.php
index 108ecfc..db04012 100644
--- a/admin/judges_teams_projects.php
+++ b/admin/judges_teams_projects.php
@@ -87,11 +87,11 @@ if($_GET['action']=="delete" && $_GET['delete'] && $_GET['edit'])
if($_POST['action']=="assign" && $_POST['edit'] && $_POST['timeslot'] && $_POST['project_id'])
{
- mysql_query("INSERT INTO judges_teams_timeslots_projects_link (judges_teams_id,judges_timeslots_id,projects_id,year) VALUES ('".$_POST['edit']."','".$_POST['timeslot']."','".$_POST['project_id']."','".$config['FAIRYEAR']."')");
+ mysql_query("INSERT INTO judges_teams_timeslots_projects_link (judges_teams_id,judges_timeslots_id,projects_id,conferences_id) VALUES ('".$_POST['edit']."','".$_POST['timeslot']."','".$_POST['project_id']."','".$conference['id']."')");
echo happy(i18n("Project assigned to team timeslot"));
}
-$q=mysql_query("SELECT DISTINCT(date) AS d FROM judges_timeslots WHERE year='".$config['FAIRYEAR']."'");
+$q=mysql_query("SELECT DISTINCT(date) AS d FROM judges_timeslots WHERE conferences_id='".$conference['id']."'");
if(mysql_num_rows($q)>1)
$show_date=true;
else
@@ -212,7 +212,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
projectnumber is not null
" . getJudgingEligibilityCode(). " AND
projects.registrations_id=registrations.id AND
- projects.year='".$config['FAIRYEAR']."'
+ projects.conferences_id='".$conference['id']."'
ORDER BY
projectnumber";
}
@@ -232,7 +232,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
" . getJudgingEligibilityCode(). " AND
projects.registrations_id=registrations.id AND
judges_teams_timeslots_projects_link.projects_id IS NULL AND
- projects.year='".$config['FAIRYEAR']."'
+ projects.conferences_id='".$conference['id']."'
ORDER BY
projectnumber";
}
@@ -300,7 +300,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
judges_teams_timeslots_projects_link.judges_timeslots_id='$r->id' AND
judges_teams_timeslots_projects_link.judges_teams_id='".$team['id']."' AND
judges_teams_timeslots_projects_link.projects_id=projects.id AND
- judges_teams_timeslots_projects_link.year='".$config['FAIRYEAR']."'
+ judges_teams_timeslots_projects_link.conferences_id='".$conference['id']."'
ORDER BY
projectnumber
");
@@ -407,7 +407,7 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
judges_teams_timeslots_projects_link.judges_timeslots_id='$r->id' AND
judges_teams_timeslots_projects_link.judges_teams_id='".$team['id']."' AND
judges_teams_timeslots_projects_link.projects_id=projects.id AND
- judges_teams_timeslots_projects_link.year='".$config['FAIRYEAR']."'
+ judges_teams_timeslots_projects_link.conferences_id='".$conference['id']."'
ORDER BY
projectnumber
");
diff --git a/admin/judging_score_edit.php b/admin/judging_score_edit.php
index 8bceaf2..fd064f8 100644
--- a/admin/judging_score_edit.php
+++ b/admin/judging_score_edit.php
@@ -32,7 +32,6 @@
'Judging Score Entry' => 'admin/judging_score_entry.php')
);
- $year=$config['FAIRYEAR'];
$project_id = NULL;
if($_GET['projectid']) {
$project_id = $_GET['projectid'];
@@ -50,7 +49,7 @@
mysql_query("UPDATE judges_teams_timeslots_projects_link
SET score=" . $score .
" WHERE judges_teams_id = " . mysql_real_escape_string($_POST["team_" . $curr_team . "_id"]) .
- " and projects_id =$project_id and year=$year");
+ " and projects_id =$project_id and conferences_id={$conference['id']}");
echo mysql_error();
}
$curr_team--;
@@ -60,11 +59,11 @@
?>
if($project_id) {
-$q=mysql_query("SELECT * FROM projectcategories WHERE year='$year' ORDER BY id");
+$q=mysql_query("SELECT * FROM projectcategories WHERE conferences_id='{$conference['id']} ORDER BY id");
while($r=mysql_fetch_object($q))
$cats[$r->id]=$r->category;
-$q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id");
+$q=mysql_query("SELECT * FROM projectdivisions WHERE conferences_id='{$conference['id']} ORDER BY id");
$q=mysql_query("SELECT judges_teams_timeslots_projects_link.judges_teams_id,
diff --git a/admin/judging_score_entry.php b/admin/judging_score_entry.php
index 9547408..20329af 100644
--- a/admin/judging_score_entry.php
+++ b/admin/judging_score_entry.php
@@ -27,8 +27,8 @@
require_once("judges.inc.php");
user_auth_required('admin');
- if($_GET['year']) $year=$_GET['year'];
- else $year=$config['FAIRYEAR'];
+ if($_GET['conferences_id']) $conferences_id=$_GET['conferences_id'];
+ else $conferences_id=$conference['id'];
if($_GET['csv'] == 'yes') {
header("Content-type: text/csv");
@@ -42,11 +42,11 @@
}
?>
-$q=mysql_query("SELECT * FROM projectcategories WHERE year='$year' ORDER BY id");
+$q=mysql_query("SELECT * FROM projectcategories WHERE conferences_id = '$conferences_id' ORDER BY id");
while($r=mysql_fetch_object($q))
$cats[$r->id]=$r->category;
-$q=mysql_query("SELECT * FROM projectdivisions WHERE year='$year' ORDER BY id");
+$q=mysql_query("SELECT * FROM projectdivisions WHERE conferences_id = '$conferences_id' ORDER BY id");
while($r=mysql_fetch_object($q))
$divs[$r->id]=$r->division;
@@ -73,7 +73,7 @@ $ORDERBY="projects.projectcategories_id, projects.projectdivisions_id, projects.
left outer join projects on projects.registrations_id=registrations.id
left outer join judges_teams_timeslots_projects_link on projects.id=judges_teams_timeslots_projects_link.projects_id
WHERE
- registrations.year='$year' "
+ registrations.conferences_id='$conferences_id' "
. getJudgingEligibilityCode() . "
GROUP BY projectid
ORDER BY
@@ -163,7 +163,7 @@ $(document).ready(function() {
}
echo number_format($r->score_count, 0) . "/" . number_format($r->score_total_count, 0) . "\n";
echo "
";
- if($year==$config['FAIRYEAR']) {
+ if($conferences_id == $conference['id']){
echo "projectid\">";
echo i18n("Edit Scores");
echo "";
diff --git a/admin/project_editor.php b/admin/project_editor.php
index ac1716f..9e7aced 100644
--- a/admin/project_editor.php
+++ b/admin/project_editor.php
@@ -42,7 +42,7 @@ if($auth_type == 'fair') {
the master copy of the fairs_id in the project */
$q=mysql_query("SELECT * FROM projects WHERE
registrations_id='$registrations_id'
- AND year='{$config['FAIRYEAR']}'
+ AND conferences_id='{$conference['id']}'
AND fairs_id=$fairs_id");
if(mysql_num_rows($q) != 1) {
echo "permission denied.";
@@ -62,7 +62,7 @@ case 'project_regenerate_number':
project_save();
/* Now generate */
- $q=mysql_query("SELECT id FROM projects WHERE registrations_id='{$registrations_id}' AND year='{$config['FAIRYEAR']}'");
+ $q=mysql_query("SELECT id FROM projects WHERE registrations_id='{$registrations_id}' AND conferences_id='{$conference['id']}'");
$i=mysql_fetch_assoc($q);
$id = $i['id'];
@@ -89,10 +89,10 @@ exit;
function project_save()
{
- global $registrations_id, $config;
+ global $registrations_id, $config, $conference;
//first, lets make sure this project really does belong to them
- $q=mysql_query("SELECT * FROM projects WHERE registrations_id='{$registrations_id}' AND year='{$config['FAIRYEAR']}'");
+ $q=mysql_query("SELECT * FROM projects WHERE registrations_id='{$registrations_id}' AND conferences_id='{$conference['id']}'");
$projectinfo=mysql_fetch_object($q);
if(!projectinfo) {
echo error(i18n("Invalid project to update"));
@@ -128,7 +128,7 @@ function project_save()
//check if they changed the project number
if($_POST['projectnumber']!=$projectinfo->projectnumber) {
//check if hte new one is available
- $q=mysql_query("SELECT * FROM projects WHERE year='".$config['FAIRYEAR']."' AND projectnumber='".$_POST['projectnumber']."'");
+ $q=mysql_query("SELECT * FROM projects WHERE conferences_id='".$conference['id']."' AND projectnumber='".$_POST['projectnumber']."'");
if(mysql_num_rows($q)) {
error_("Could not change project number. %1 is already in use",array($_POST['projectnumber']));
} else {
@@ -143,14 +143,14 @@ function project_save()
function project_load()
{
- global $registrations_id, $config;
+ global $registrations_id, $config, $conference;
//now lets find out their MAX grade, so we can pre-set the Age Category
$q=mysql_query("SELECT MAX(grade) AS maxgrade FROM students WHERE registrations_id='".$registrations_id."'");
$gradeinfo=mysql_fetch_object($q);
//now lets grab all the age categories, so we can choose one based on the max grade
- $q=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY id");
+ $q=mysql_query("SELECT * FROM projectcategories WHERE conferences_id='".$conference['id']."' ORDER BY id");
while($r=mysql_fetch_object($q)) {
//save these in an array, just incase we need them later (FIXME: remove this array if we dont need it)
$agecategories[$r->id]['category']=$r->category;
@@ -162,7 +162,7 @@ function project_load()
}
//now select their project info
- $q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$registrations_id."' AND year='".$config['FAIRYEAR']."'");
+ $q=mysql_query("SELECT * FROM projects WHERE registrations_id='".$registrations_id."' AND conferences_id='".$conference['id']."'");
//check if it exists, if we didnt find any record, lets insert one
$projectinfo=mysql_fetch_object($q);
@@ -229,11 +229,11 @@ function countwords()
//###### Feature Specific - filtering divisions by category
if($config['filterdivisionbycategory']=="yes"){
- $q=mysql_query("SELECT projectdivisions.* FROM projectdivisions,projectcategoriesdivisions_link WHERE projectdivisions.id=projectdivisions_id AND projectcategories_id=".$projectcategories_id." AND projectdivisions.year='".$config['FAIRYEAR']."' AND projectcategoriesdivisions_link.year='".$config['FAIRYEAR']."' ORDER BY division");
+ $q=mysql_query("SELECT projectdivisions.* FROM projectdivisions,projectcategoriesdivisions_link WHERE projectdivisions.id=projectdivisions_id AND projectcategories_id=".$projectcategories_id." AND projectdivisions.conferences_id='".$conference['id']."' AND projectcategoriesdivisions_link.conferences_id='".$conference['id']."' ORDER BY division");
echo mysql_error();
//###
} else
- $q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY division");
+ $q=mysql_query("SELECT * FROM projectdivisions WHERE conferences_id='".$conference['id']."' ORDER BY division");
echo "