diff --git a/judge_main.php b/judge_main.php
index 8c075d44..7837e24a 100644
--- a/judge_main.php
+++ b/judge_main.php
@@ -47,6 +47,21 @@
}
echo "
";
+ /* Check for any judging team assignment this year for this judge,
+ * if there is one, print the judge scheule link in an obvious place,
+ * it's less obvious below */
+ $q = mysql_query("SELECT id FROM judges_teams_link WHERE
+ users_id='{$u['id']}' AND year='{$config['FAIRYEAR']}'");
+ if(mysql_num_rows($q) > 0) {
+ echo '';
+ echo i18n("You have been assigned to a judging team. %1Click here%2 to view the judging schedule",
+ array("",""));
+ echo '';
+ echo '
';
+ }
+
+
+
//first, we need to see if they havec the current FAIRYEAR activated, if not, we'll keep their acocunt 'dormant' and it wont
//be used for anything, but will still be available for them to login in the following years.
@@ -91,6 +106,7 @@
echo i18n('Other Options and Things To Do').':
';
echo '
';
+ echo '- '.i18n('Check the Judging Schedule').' - '.i18n('Look at the judging team(s) you have been assigned to, and the projects you will judge.').'
';
echo '- '.i18n('Change Password').' - '.i18n('Change your password').'
';
echo '- '.i18n('Activate/Deactivate Role').' - '.
i18n('Activate/Deactiate/Remove/Delete roles or your entire account').
diff --git a/judge_project_summary.php b/judge_project_summary.php
new file mode 100644
index 00000000..e8f07d9a
--- /dev/null
+++ b/judge_project_summary.php
@@ -0,0 +1,90 @@
+
+/*
+ This file is part of the 'Science Fair In A Box' project
+ SFIAB Website: http://www.sfiab.ca
+
+ Copyright (C) 2005 Sci-Tech Ontario Inc
+ Copyright (C) 2005 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_once('common.inc.php');
+require_once('user.inc.php');
+
+user_auth_required(array('judge', 'committee'));
+
+$pn = mysql_escape_string(stripslashes($_GET['pn']));
+
+
+
+$q=mysql_query("SELECT * FROM projects WHERE
+ projectnumber='$pn'
+ AND year='{$config['FAIRYEAR']}'");
+if(mysql_num_rows($q)==0) {
+ echo "not found";
+ exit;
+}
+$pi = mysql_fetch_object($q);
+
+
+
+$sq = mysql_query("SELECT firstname,lastname,school FROM students
+ LEFT JOIN schools ON schools.id = students.schools_id
+ WHERE
+ registrations_id='{$pi->registrations_id}'
+ AND students.year='{$config['FAIRYEAR']}'");
+
+$student = array();
+while($si = mysql_fetch_object($sq)) {
+ $student[] = $si->firstname.' '.$si->lastname;
+ $school = $si->school;
+}
+
+$students = implode(' and ', $student);
+
+if(file_exists($prependdir."data/logo-100.gif"))
+ $logo = "
";
+else
+ $logo = "";
+
+
+?>
+
+Project Summary for =$pi->projectnumber?>
+
+
+
+
+
+
+ =$logo?> |
+
+ =$pi->title?>
+ =$students?>
+ =$school?>
+ Floor Location : =$pi->projectnumber?> |
+ |
+
+
+
+
+=nl2br(htmlspecialchars($pi->summary))?>
+
+
+
+
+?>
diff --git a/judge_schedule.php b/judge_schedule.php
new file mode 100644
index 00000000..b294ba1d
--- /dev/null
+++ b/judge_schedule.php
@@ -0,0 +1,155 @@
+
+/*
+ This file is part of the 'Science Fair In A Box' project
+ SFIAB Website: http://www.sfiab.ca
+
+ Copyright (C) 2005 Sci-Tech Ontario Inc
+ Copyright (C) 2005 James Grant
+ Copyright (C) 2009 David 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_once('common.inc.php');
+require_once('user.inc.php');
+require_once('judge.inc.php');
+require_once('projects.inc.php');
+
+/* Sort out who we're editting */
+if($_POST['users_id'])
+ $eid = intval($_POST['users_id']); /* From a save form */
+else if(array_key_exists('embed_edit_id', $_SESSION))
+ $eid = $_SESSION['embed_edit_id']; /* From the embedded editor */
+else
+ $eid = $_SESSION['users_id']; /* Regular entry */
+
+if($eid != $_SESSION['users_id']) {
+ /* Not editing ourself, we had better be
+ * a committee member */
+ user_auth_required('committee','admin');
+} else {
+ user_auth_required('judge');
+}
+
+$u = user_load($eid);
+
+ send_header("Schedule",
+ array('Judge Main' => 'judge_main.php',
+ ),
+ "judge_schedule"
+ );
+
+
+/* Find all judging teams this judge is on */
+$q = mysql_query("SELECT * FROM judges_teams_link
+ LEFT JOIN judges_teams ON judges_teams.id=judges_teams_link.judges_teams_id
+ WHERE judges_teams_link.users_id='{$u['id']}'
+ AND judges_teams_link.year='{$config['FAIRYEAR']}'");
+$teams = array();
+while($t = mysql_fetch_assoc($q)) {
+ /* Load timeslot data for this team (team -> judges_timeslots_link -> timeslot -> parent timeslot */
+ $qq = mysql_query("SELECT T.* FROM judges_teams_timeslots_link
+ LEFT JOIN judges_timeslots ON judges_timeslots.id=judges_teams_timeslots_link.judges_timeslots_id
+ LEFT JOIN judges_timeslots AS T ON T.id=judges_timeslots.round_id
+ WHERE judges_teams_timeslots_link.judges_teams_id={$t['id']}");
+ $tt = mysql_fetch_assoc($qq);
+ echo mysql_error();
+ $t['timeslot'] = $tt;
+
+ /* Load award */
+ $qq = mysql_query("SELECT award_awards.*,T.type FROM judges_teams_awards_link
+ LEFT JOIN award_awards ON award_awards.id=judges_teams_awards_link.award_awards_id
+ LEFT JOIN award_types as T ON T.id=award_awards.award_types_id
+ WHERE judges_teams_awards_link.judges_teams_id={$t['id']}");
+ echo mysql_error();
+ $aa = mysql_fetch_assoc($qq);
+ $t['award'] = $aa;
+
+ /* Load team members */
+ $qq = mysql_query("SELECT * FROM judges_teams_link
+ LEFT JOIN users ON users.id=judges_teams_link.users_id
+ WHERE judges_teams_link.judges_teams_id={$t['id']}
+ ORDER BY judges_teams_link.captain,users.lastname,users.firstname");
+ $t['members'] = array();
+ while(($mm = mysql_fetch_assoc($qq))) {
+ $t['members'][] = $mm;
+ }
+
+ /* Load projects */
+ $qq = mysql_query("SELECT projects.id,projects.projectnumber,projects.title FROM judges_teams_timeslots_projects_link
+ LEFT JOIN projects ON projects.id=judges_teams_timeslots_projects_link.projects_id
+ WHERE judges_teams_id={$t['id']}");
+ $p = array();
+ while(($pp = mysql_fetch_assoc($qq)))
+ $p[] = $pp;
+ /* If no project and it's a special award, get all nominated */
+ if(count($p) == 0 && $aa['type'] == 'Special') {
+ $p = getProjectsNominatedForSpecialAward($aa['id']);
+ }
+
+ $t['projects'] = $p;
+ $teams[] = $t;
+}
+
+foreach($teams as $t) {
+ $d = format_date($t['timeslot']['date']);
+ $t1 = format_time($t['timeslot']['starttime']);
+ $t2 = format_time($t['timeslot']['endtime']);
+ echo "$d $t1 - $t2
";
+ echo "".i18n('Team')." {$t['num']} - {$t['name']}
";
+ echo "".i18n('Team Members').':';
+ echo ' | ';
+ foreach($t['members'] as $m) {
+ echo "{$m['firstname']} {$m['lastname']}";
+ if($m['captain'] == 'yes') echo '('.i18n('captain').')';
+ echo ' ';
+ }
+ echo ' |
';
+
+ echo "".i18n('Projects').':';
+ echo ' | ';
+
+ echo '';
+ foreach($t['projects'] as $p) {
+ $pn = urlencode($p['projectnumber']);
+ echo "{$p['projectnumber']} | - | {$p['title']} | ";
+ echo " ";
+ }
+ echo ' ';
+
+ echo ' |
';
+
+ echo '
';
+}
+
+if(count($teams) == 0) {
+ echo i18n("You have not been assigned to a judging team. This could be
+ because the organizers haven't completed assignments. Contact the fair
+ organizers if you believe this is incorrect. For most fairs, you can safely just show up to the
+ fair anyway, there is always a need for judges.");
+}
+
+//echo "";
+//print_R($teams);
+
+send_footer();
+
+?>
+
+
+
+if($_SESSION['embed'] != true) send_footer();
+?>