science-ation/register_judges_main.php

190 lines
7.1 KiB
PHP

<?
/*
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 <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
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");
include "register_judges.inc.php";
send_header("Judges Registration");
if($_GET['action']=="activate")
{
mysql_query("INSERT INTO judges_years (judges_id,year) VALUES ('".$_SESSION['judges_id']."','".$config['FAIRYEAR']."')");
echo happy(i18n("Judge profile for %1 successfully activated",array($config['FAIRYEAR'])));
}
if($_GET['action']=="deactivate")
{
mysql_query("DELETE FROM judges_years WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'");
echo happy(i18n("Judge profile for %1 successfully deactivated",array($config['FAIRYEAR'])));
}
if($_GET['action']=="delete")
{
//okay here we go, lets get rid of them completely, since this is what theyve asked for
echo happy(i18n("Judge account successfully deleted. Goodbye!",array($config['FAIRYEAR'])));
mysql_query("UPDATE judges SET deleted='yes', deleteddatetime=NOW() WHERE id='".$_SESSION['judges_id']."'");
unset($_SESSION['judges_id']);
unset($_SESSION['email']);
send_footer();
exit;
}
//only display the named greeting if we have their name
if($judgeinfo->firstname)
{
echo i18n("Hello <b>%1</b>",array($judgeinfo->firstname));
echo "<br />";
}
echo "<br />";
//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.
$q=mysql_query("SELECT * FROM judges_years WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'");
if(!mysql_num_rows($q))
{
echo i18n("If you would like to participate as a judge for the %1 %2 please click the '<b>Activate %3 Judge Profile</b>' button below to activate your judges account for the fair",array($config['FAIRYEAR'],$config['fairname'],$config['FAIRYEAR']));
echo "<br />";
echo "<br />";
echo i18n("If you can not judge this year, but would like to remain on our mailing list for future years, no action is necessary");
echo "<br />";
echo "<br />";
echo i18n("If you would like to be completely removed from our judges mailing list, please click the '<b>Delete Judge Account</b>' button below");
echo "<br />";
echo "<br />";
echo "<form method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<input type=\"hidden\" name=\"action\" value=\"activate\">\n";
echo "<input style=\"width: 300px;\" type=\"submit\" value=\"".i18n("Activate %1 Judge Profile",array($config['FAIRYEAR']))."\">";
echo "</form>";
}
else
{
$overallstatus="complete";
echo i18n("Please use the checklist below to complete your registration. Click on an item in the table to edit that information. When you have entered all information, the <b>Status</b> field will change to <b>Complete</b>");
echo "<br />";
echo "<br />";
echo "<table class=\"summarytable\">";
echo "<tr><th>".i18n("Registration Item")."</th><th>".i18n("Status")."</th></tr>";
//judges personal information
echo "<tr><td>";
echo "<a href=\"register_judges_personal.php\">";
echo i18n("Personal Information");
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statuspersonal=personalStatus();
echo outputStatus($statuspersonal);
if($statuspersonal!="complete") $overallstatus="incomplete";
echo "</td></tr>";
/*
//organization information
echo "<tr><td>";
echo "<a href=\"register_judges_organization.php\">";
echo i18n("Organization Information");
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statusorganization=organizationStatus();
echo outputStatus($statusorganization);
echo "</td></tr>";
*/
//area of expertise
echo "<tr><td>";
echo "<a href=\"register_judges_expertise.php\">";
echo i18n("Areas of Expertise");
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statusexpertise=expertiseStatus();
echo outputStatus($statusexpertise);
if($statusexpertise!="complete") $overallstatus="incomplete";
echo "</td></tr>";
// special awards
if($config['judges_specialaward_enable'] == 'yes' || $judgeinfo->typepref == 'speconly') {
echo "<tr><td>";
echo "<a href=\"register_judges_specialawards.php\">";
echo i18n("Special Award Preferences");
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statusspecialawards=specialawardStatus();
echo outputStatus($statusspecialawards);
if($statusspecialawards!="complete") $overallstatus="incomplete";
echo "</td></tr>";
}
echo "<tr><td colspan=\"2\"><hr></td></tr>";
echo "<tr><td>".i18n("Overall Status")."</td><td>";
echo outputStatus($overallstatus);
echo "</td></tr>";
echo "</table>";
echo "<br />";
echo "<br />";
if($overallstatus!="complete")
{
echo error(i18n("You will not be marked as an active judge until your \"Overall Status\" is \"Complete\""));
}
else
{
echo happy(i18n("Thank you for completing the judge registration process. We look forward to seeing you at the fair"));
}
echo "<br />";
echo i18n("If you are unable to participate as a judge in the %1 %2 please click the deactivate button below to deactivate your judges account for the fair",array($config['FAIRYEAR'],$config['fairname']));
echo "<br />";
echo "<br />";
echo "<form method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<input type=\"hidden\" name=\"action\" value=\"deactivate\">\n";
echo "<input style=\"width: 300px;\" onclick=\"return confirmClick('".i18n("Are you sure you want to deactivate your judges profile for %1?",array($config['FAIRYEAR']))."')\" type=\"submit\" value=\"".i18n("Deactivate %1 Judge Profile",array($config['FAIRYEAR']))."\">";
echo "</form>";
}
echo "<br />";
echo "<form method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n";
echo "<input style=\"width: 300px;\" onclick=\"return confirmClick('".i18n("Are you sure you want to completely delete your judges account? \\n Doing so will remove you from our mailing list for future years and you will never hear from us again")."')\" type=\"submit\" value=\"".i18n("Delete Judge Account")."\">";
echo "</form>";
echo "<br />";
echo "<a href=\"register_judges_password.php\">".i18n("Change Password")."</a>";
echo "<br />";
echo "<a href=\"register_judges.php?action=logout\">".i18n("Logout")."</a>";
send_footer();
?>